import java.util.Scanner;

public class Main{
    public static void main(String args[]) {
        Scanner input = new Scanner(System.in);
        int n = input.nextInt();
        for(int i = 0; i < n; i++) {
            String str = input.next();
            if(str.equals("Circle")) {
                Circle c = new Circle(input.nextDouble());
                System.out.println("The area of " + c.toString() + " is " + c.getArea());
                System.out.println("The perimeter of " + c.toString() + " is "+ c.getPerimeter());
            } else if(str.equals("Cylinder")) {
                Cylinder r = new Cylinder(input.nextDouble(), input.nextDouble());
                System.out.println("The area of " + r.toString() + " is " + r.getArea());
                System.out.println("The volume of " + r.toString() + " is "    + r.getVolume());
            }
        }
    }
}

/* 请在这里填写答案 */
class Circle{
    private double radius;//半径
    public Circle(double radius){
        this.radius=radius;
    }
    public Circle(){
        this.radius=0;
    }
    void setRadius(double r){
        this.radius=r;
    }
    double getRadius(){
        return this.radius;
    }
    double getArea(){
        return Math.PI*this.radius*this.radius;
    }
    double getPerimeter(){
        return 2*Math.PI*this.radius;
    }

    @Override
    public String toString() {
        return "Circle(r:"+this.radius+")";
    }
}
class Cylinder extends Circle{
    private double height;
    public Cylinder(double radius,double height){
        this.height=height;
        super.setRadius(radius);
    }
    public Cylinder(){
        this.height=0;
        super.setRadius(0.0);
    }
    void setHeight(double height){
        this.height=height;
    }
    double getHeight(){
        return this.height;
    }
    double getArea(){
        return 2*super.getArea()+getPerimeter()*this.height;
    }
    double getVolume(){
        return super.getArea()*this.height;
    }

    @Override
    public String toString() {
        return "Cylinder(r:"+getRadius()+",h:"+this.height+")";
    }
}